package cn.neusoft.service.impl;

import cn.neusoft.mapper.BusinessMapper;
import cn.neusoft.pojo.Business;
import cn.neusoft.service.IAppService;
import cn.neusoft.vo.ResultBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.sql.SQLException;
import java.util.List;

@Service
public class AppService implements IAppService {
	@Autowired
	private BusinessMapper businessMapper;
	@Override
	public ResultBean getRecommendBusiness() throws SQLException {
		List<Business> all = businessMapper.getAll();
		return all.size()>5?ResultBean.SUCCESS(all.subList(0,5)):ResultBean.SUCCESS(all);
	}
}
